import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'

const r = (p: string) => new URL(p, import.meta.url).pathname

export default defineConfig({
    // 解决The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.问题
    css: {
        preprocessorOptions: {
            scss: {
                api: 'modern-compiler'
            }
        }
    },
    // @取代 ./src 作为别名
    resolve: {
        alias: {
            '@': r('./src')
        }
    },
    plugins: [
        vue(),
    ],

    server: {
        port: 5173,
        open: true
    }
})
